babl: skip unknown formats when loading cache
authorØyvind Kolås <pippin@gimp.org>
Wed, 13 Sep 2017 16:04:49 +0000 (18:04 +0200)
committerØyvind Kolås <pippin@gimp.org>
Wed, 13 Sep 2017 16:04:49 +0000 (18:04 +0200)
Fixes bug #787467.

Formats based on custom primaries provided by applications are unknown to babl
at launch, we still want to keep the data though, since this list of most used
fishes first is useful resource in combination with the warnings about missing
fast paths.

babl/babl-cache.c

index 0200a11c264eb8b2992999d9245a5965f74a1a7d..fa3f3879acd99eea123305f3f58395e6953bb47d 100644 (file)
@@ -257,7 +257,7 @@ void babl_init_db (void)
           }
           break;
         case '\t':
-          if (strchr (token, '='))
+          if (to_format && strchr (token, '='))
           {
             char seps2[] = " ";
             char *tokp2;
@@ -307,7 +307,7 @@ void babl_init_db (void)
               token2 = strtok_r (NULL, seps2, &tokp2);
             }
           }
-          else
+          else if (to_format)
           {
             Babl *conv = (void*)babl_db_find(babl_conversion_db(), &token[1]);
             if (!conv)
@@ -322,14 +322,10 @@ void babl_init_db (void)
           if (!from_format)
           {
             from_format = (void*)babl_db_find(babl_format_db(), token);
-            if (!from_format)
-              return;
           }
           else
           {
             to_format = (void*)babl_db_find(babl_format_db(), token);
-            if (!to_format)
-              return;
           }
           break;
       }